package entity;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.UUID;

public class GroupMessage implements Serializable {

    private static final long serialVersionUID = 1120088971891714112L;
    private UUID uuid;
    private UUID groupId;
    private String senderUsername;
    private LocalDateTime time;
    private String content;

    public GroupMessage(UUID groupId, String senderUsername, LocalDateTime time, String content) {
        uuid = UUID.randomUUID();
        this.groupId = groupId;
        this.senderUsername = senderUsername;
        this.time = time;
        this.content = content;
    }

    public GroupMessage(GroupMessage other) {
        this.uuid = other.uuid;
        this.groupId = other.groupId;
        this.senderUsername = other.senderUsername;
        this.time = other.time;
        this.content = other.content;
    }

    public UUID getUuid() {
        return uuid;
    }

    public UUID getGroupId() {
        return groupId;
    }

    public String getSenderUsername() {
        return senderUsername;
    }

    public LocalDateTime getTime() {
        return time;
    }

    public String getContent() {
        return content;
    }

    public void setTime(LocalDateTime time) {
        this.time = time;
    }
}
